<?php
exists_frame();
class librdm  extends libdata{
    public $return_data = false;
    public $request_data;
    public $status =0;
    public $message = false;
    public $jump = false;
    public $cfg = null;
    public $session = null;
    public $cookie = null;
    protected $dbm = null;
    protected $salt = '';
    protected $visit_ip = null;
    protected $visit_time = 0;
    public function init_base_obj($cfg,$dm, $vt, $vi) {
        $this->visit_time = $vt;
        $this->visit_ip = $vi;
        $this->cfg = $cfg;
        $this->dbm = $dm;
        $this->set_salt();
        $this->session_instance();
        $this->cookie_instance();
    }
    public function session_instance() {
        $this->session = new libsession();
    }
    public function cookie_instance() {
        $this->cookie = new libcookie();
    }
    public function set_salt() {
        $this->salt = empty($this->cfg->salt) ? md5(__FILE__.PHP_VERSION.PHP_OS) :$this->cfg->salt;
    }
    public function load_data_operate_class($name,$arg ='') {
        if(isset($this->dbm[$name])) return $this->dbm[$name];
        else return false;
    }
}
